package com.itheima.fanxing.demo1;

import java.util.Collections;
import java.util.TreeSet;

public class Demo1 {
    public static void main(String[] args) {
        TreeSet<String> set=new TreeSet<>();
        Collections.addAll(set,"1","2","3","4");
        for (String s : set) {
            System.out.println(s);
        }
        System.out.println("-----------------------");
        TreeSet<Integer> set1=new TreeSet<>();
        Collections.addAll(set1,1,2,3,4,5);
        for (Integer integer : set1) {
            System.out.println(integer);
        }
    }
}
